<template>
  <div class="choose-wrap" v-document-click='documentClick'>
    <div class="choose" >
      <span>{{title}}</span>
      <i class="el-icon-caret-bottom" @click="showwrap"></i>
      <div :class="{'mt-content' :true,'active':showWrapperActive}">
          <h2>{{value}}</h2>
          <div class="wrapper">
              <div class="col">
                  <span :class="{'mt-item':true,'active' :item==value}" v-for="(item,index) in list " :key="index" @click='changeValue(item)'>{{item}}</span>
              </div>
          </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
    data(){
        return{
            // showWrapperActive:false
        }
    },
    props:[
        "list",
        "title",
        "value",
        "showWrapperActive"

    ],
    methods:{
        showwrap(e){
            e.stopPropagation();
            // this.showWrapperActive = true
            this.$emit('change_active',true)
        },
        documentClick(){
            // this.showWrapperActive = false;
            // console.log('document-click')
            this.$emit('change_active',false)
        },
        changeValue(item){
            this.$emit('change',item)
        }
        
        
        
        
        
    }
};
</script>

<style lang='scss'>
@import '@/assets/css/changecity/iselect.scss'
</style>